﻿
<%namespace YouHP.Model%>
<%namespace YouHP.Utility%>

<%template _Header%>
<style>
.receiver_input
{
	border:1px solid #808080;
}
.receiver_input .f_button
{
	float:right;
margin:3px 2px 0 0;
padding:3px 2px 0 0;
position:relative;
}   
    
.myfriendlist {
background:#FFFFFF none repeat scroll 0 0;
border:1px solid #98B1C8;
padding:2px;
position:absolute;
right:-3px;
top:25px;
}
.myfriendlist .myfriendlist_bar
{
	background:#F2F6FB none repeat scroll 0 0;
border-bottom:1px solid #EEEEEE;
color:#000000;
height:20px;
padding:2px 5px;

}

.myfriendlist .myfriendlist_lst
{
	height:150px;
	padding:2px;
}
.myfriendlist .myfriendlist_bottom
{
	padding:5px;
}
.myfriendlist .item
{
	width:120px;
	float:left;
	margin-bottom:3px;
}
</style>

<script type="text/javascript">
var query = location.href.substring(location.href.indexOf("?")); 

function loadActionList()
{
  
  var aurl = "/Pages/alpha/Ajax/ActionListAjax.aspx"+query+"&page=1";
  var myAjax=new Ajax(aurl,
  {
     method:'get',
     onComplete:function()
     {
      var html=this.response.text;
      _$("ActionList").innerHTML=html;
     }
   }
   );
   myAjax.request();
  
  
}

function ViewActionPage(pageindex)
{
  
  var aurl = "/Pages/alpha/Ajax/ActionListAjax.aspx"+query+"&page="+pageindex;
  var myAjax=new Ajax(aurl,
  {
     method:'get',
     onComplete:function()
     {
      var html=this.response.text;
      _$("ActionList").innerHTML=html;
      }
   }
   );
   myAjax.request();
  
  
} 
 
function ActionDelete(id)
{
  
  var aurl = "/Pages/alpha/Ajax/ActionDeleteAjax.aspx"+query+"&id="+id;
  var myAjax=new Ajax(aurl,
  {
     method:'get',
     onComplete:function()
     {
      var html=this.response.text;
      _$("ActionList").innerHTML=html;
      }
   }
   );
   myAjax.request();
  
  
} 


function ActionAdd()
{

  var msg = _$("msg").value;
  if(msg == _$("msg").defaultValue)  msg="";
  
  var actiontype = 0;
  var form = _$('feedback');
  for(var i = 0;i < form.elements.length;i++)
  {
      var e = form.elements[i];
      if(e.name == "hugtype")
      {
         if(e.checked == true)
         {
             actiontype = e.value;
             break;
         }
      }
   }   

    if(msg.length > 300 ) 
    {
        alert("陈述内容不能超过300个字！");
        return;
    }
    _$("submitbutton").value = "正在处理...";
    var aurl = "/Pages/alpha/Ajax/ActionAddAjax.aspx"+query+"&msg="+msg.escUrl()+"&actiontype="+actiontype;
    var myAjax=new Ajax(aurl,
    {
         method:'post',
         onComplete:function()
         {
              
                   var html=this.response.text;    
                   _$("ActionList").innerHTML=html;
                   _$("msg").value=""; 
                   _$("submitbutton").value = "马上发表";

          }
    }
   );
   myAjax.request();
  
  
}

function ActionReplyAdd(id,toUserId)
{

          var replycontent = _$("replycontent"+id).value;
          if(replycontent == _$("replycontent"+id).defaultValue)  replycontent="";
          
          var actiontype = 0;
          var form = _$('huglist'+id);
          for(var i = 0;i < form.elements.length;i++)
          {
              var e = form.elements[i];
              if(e.name == "r_hugtype")
              {
                 if(e.checked == true)
                 {
                     actiontype = e.value;
                     break;
                 }
              }
           }   

            if(replycontent.length > 300 ) 
            {
                alert("陈述内容不能超过300个字！");
                return;
            }
      
      var aurl = "/Pages/alpha/Ajax/ActionSendAjax.aspx"+query+"&msg="+replycontent.escUrl()+"&actiontype="+actiontype+"&toUserId="+toUserId;
      var myAjax=new Ajax(aurl,
      {
         method:'get',
         onComplete:function()
         {
           alert(this.response.text);
           _$('replycontent'+id).value = "";
           _$('replybox'+id).style.display = 'none';
          }
       }
       );
       myAjax.request();


}

function replyadd(id)
{

      _$('replybox'+id).style.display = 'block';
}
function replycancell(id)
{

      _$('replybox'+id).style.display = 'none';
}

loadActionList();
</script>


<div class="layout2-cols2">
<%template _memmenu%>
	<div class="pannelcontent">

		<div class="pcontent">
		<div class="panneldetail">
		<div class="panneltabs">

		<%csharp%> TempUrl = "/User/ActionList.aspx?uid="+UserData.Id;<%/csharp%>
					 <a href="{this.GetUrl(TempUrl)}"
					  <%if {PageName}=="actionlist.aspx"%>
					  class="current"
					  <%/if%>>我收到的互动</a>
					  
					   <a href="{this.GetUrl("/User/ActionSend.aspx")}"
					  <%if {PageName}=="actionsend.aspx"%>
					  class="current"
					  <%/if%>>给病友发互动</a>
	
				</div>
		<div class="pannelbody">
		
<%if IsPost%>
     <%template _msgbox%>
<%else%> 	  
	  		
	    
	 <div class="box">

	          <div id="ActionList">
	            <div style="padding:20px 50px;">
                <%csharp%> TempUrl = "/images/indicator_medium.gif";<%/csharp%>
                <img src="{this.GetResource(TempUrl)}" /><b>正在加载互动……</b>

                </div>
 
	        </div>
	    

	 </div>



<%/if%>
</div>

</div>
</div>
</div>
</div>



<%template _footer%>		
